﻿using Abp.Application.Services.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Commodity.Commodities.Dto
{
    public class ShoppingOptionDto: EntityDto
    {
        public double Price { get; set; }
        public int XPValue { get; set; }
        public int Inventory { get; set; }
        public int MinLimitCount { get; set; }
        public int MaxLimitCount { get; set; }
        public string Picture { get; set; }
        public List<string> Pictures { get; set; }
        public Dictionary<string, string> ShoppingOptionParameters { get; set; }

        public ShoppingOptionDto()
        {
            Pictures = new List<string>();
            ShoppingOptionParameters = new Dictionary<string, string>();
        }

        public ShoppingOptionDto(CommodityShoppingOption value)
        {
            Id = value.Id;
            Price = value.Price;
            XPValue = value.XPValue;
            Inventory = value.Inventory;
            MinLimitCount = value.MinLimitCount;
            MaxLimitCount = value.MaxLimitCount;
            Picture = value.Pictures.Items.FirstOrDefault();
            Pictures = value.Pictures.Items;
            ShoppingOptionParameters = value.ShoppingOptionParameters;
        }
    }
}
